//
//  NetManager.h
//  Net2
//
//  Created by Justsoso on 16/3/29.
//  Copyright © 2016年 Justsoso. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Singleton.h"

@protocol NetManagerDeleage <NSObject>

- (void)loginSuccess;
- (void)loginFail:(NSError *)error;

- (void)requestMovieListSuccess:(NSArray *)success;
- (void)requestMovieListFail:(NSError *)fail;

@end

@interface NetManager : NSObject

SingletonH(NetManager)

+ (BOOL)longWithUserName:(NSString *)username andPassWord:(NSString *)password;

+ (void)longWithUserName:(NSString *)username
             andPassWord:(NSString *)password
            successBlock:(void (^)())successBlock
             failedBlock:(void(^)(NSError *error))failBlock;

+ (void)requestMovieListWithSuccessBlock:(void (^)(NSArray *arr))successBlock
                             failedBlock:(void (^)(NSError *error))failBlock;


@property (nonatomic,weak) id <NetManagerDeleage> delegate;

/**
 *  1. 登录
 *
 *  @param username 用户名
 *  @param password 密码
 */
- (void)longWithUserName:(NSString *)username
             andPassWord:(NSString *)password;
/**
 *  2. 获取电影列表
 */
- (void)requestMovieList;


@end
